﻿using CommunityToolkit.Mvvm.Messaging;
using Enterprises.Wpf.Sample.UserControls.Main;
using Enterprises.Wpf.Sample.ViewModel.Main;
using HandyControl.Controls;
using HandyControl.Tools;
using Microsoft.Extensions.DependencyInjection;
using System.Windows.Input;
using Enterprises.Wpf.Core.AOP;

namespace Enterprises.Wpf.Sample
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow
    {
        public MainWindow()
        {
            InitializeComponent();
            var aopTest = new AOPTest();
            aopTest.Age = 32;
        }

        protected override void OnContentRendered(EventArgs e)
        {
            base.OnContentRendered(e);

            DataContext = App.Current.Services.GetService<MainViewModel>();

            // 实列化非客户端区域内容  导航菜单
            NonClientAreaContent = new NonClientAreaContent();

            // 实例化ControlMain内容
            ControlMain.Content = new MainWindowContent();
        }
    }
}